﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace findPrime2
{
    class Program
    {

        static void Main(string[] args)
        {
            int[] a = new int[10];
            CreateArrays.createArrays(ref a, 10);
            int max = 0, min = 0, sum = 0;
            double average;
            foreach(int i in a)
            {
                Console.Write($"{i},");
            }
            foreach(int i in a)
            {
                max = max < i ? i : max;
                min = min > i ? i : max;
                sum += i;
            }
            average = (sum + 5) / 10;
            Console.WriteLine("\n最大值："+ max);
            Console.WriteLine("最小值："+ min);
            Console.WriteLine("求和："+ sum);
            Console.WriteLine("平均数："+ average);            
            return;
        }

    }
    class CreateArrays
    {
        public static void createArrays(ref int[] a, int n)
        {
            Random random = new Random();
            for(int i = 0; i < n; i++)
            {
                a[i] = random.Next(1, 100);
            }
            return;
        }
    }
}
